import java.awt.BorderLayout;
import java.awt.event.*;
import javax.swing.*;

public class Practice7_1 implements ActionListener {
    JFrame frame ;
    JTextArea label;
    JButton button;

    public Practice7_1(){
    	frame = new JFrame();
		frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
		
		label = new JTextArea();
		button = new JButton("Button");
		button.addActionListener(this);

		frame.add(label, BorderLayout.NORTH);
		frame.add(button, BorderLayout.SOUTH);
		
		frame.pack();
		frame.setLocation(600, 300);
		frame.setVisible(true);
	}
		
	public static void main(String[] args){
		new Practice7_1();
	}	
 
   public void actionPerformed(ActionEvent e) {
       label.setText(button.getText());
   }
}
